// import router from "."
import host from "../components/host"
import axios from "axios";
import store from "@/store";
export default [
    {
        path:"/",
        component:host,
        meta:{
            isTrue:true, 
            isfooter:true
        }
    }
    ,
 {
      path:"/1",
      component:host,
      meta:{
        isTrue:true 
        , 
            isfooter:true
    }
    

 },
 {
     path:"/2-2",
     component:()=>import("../components/movie")
     ,
      meta:{
      
          isTrue:true, 
          isfooter:true
        
      
    }
 },
 {
     path:"/2-3",
     component:()=>import("../components/anime")
     ,
      meta:{
        isTrue:true, 
        isfooter:true 
        
    }
 },
 {
    path:"/login",
    component:()=>import("../views/login"),
    
      meta:{
        isTrue:false,
        isfooter:false
    }
 
    }
 
 ,{
    path:"/enroll",
    component:()=>import("../views/enroll")  
    ,
      meta:{
        isTrue:false
    }  
 },{
 path:"/node",
 component:()=>import("../views/node/nodeMovie")
 }
 ,
 {
     path:"/user",
     
      meta:{
        isTrue:false,
        isfooter:true
    },
     component:()=>import("../views/user"),
     beforeEnter:(to,from,next)=>{
         //这里是发送token给服务验证的地方
      
      let verify=localStorage.getItem("token");
      let admin=localStorage.getItem("admin")
    if(admin=="ok"){
       next("/node")
    }
      else if(verify){
        next()

      }else if(!verify){

          next("/login")
      }
           
     }
     


 },{
     path:"/host",
     component:()=>import("../components/host")
     ,
      meta:{
        isTrue:true 
    }
 },{
      path:"/phone",
      component:()=>import("../views/phone")
 },
 {
   path:"/7",
   meta:{
   
    isfooter:true
},
   component:()=>import("../components/userHost")
 },
 {
  path:"/8-1",
  component:()=>import("../components/userMovie")
  ,
   meta:{
   
    isfooter:true
}
},
{
  path:"/8-2",
  component:()=>import("../components/userAnime")
  ,
   meta:{
   
    isfooter:true
}
},
{
  path:"/9",
  component:()=>import("../views/userLike")
},
{
  path:"/exit",
  component:()=>import("../components/host"),
  meta:{
    isTrue:true,
    isfooter:true
},
beforeEnter:(to,from,next)=>{


  localStorage.removeItem("token")
  localStorage.removeItem("user")
  
  next()
}

},
{
   path:"/10",
   component:()=>import("../components/mySelf"),
   meta:{
   
    isfooter:true
}
   
}
]
